package com.caifu.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.caifu.bean.Result;
import com.caifu.bean.ResultUtil;
import com.caifu.mapper.SysRecordMapper;
import com.caifu.pojo.SysUser;
import com.caifu.service.SysRecordService;
import com.caifu.service.SysUserService;
import com.caifu.util.CheckUtil;
import com.caifu.vo.RecordVO;
import net.sf.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author szt
 * ClassName: SysRecordController.java、
 * createTime: 2021年03月09日 14:16:00
 **/
@Controller
@RequestMapping("record")
public class SysRecordController {

    private static final Logger logger = LoggerFactory.getLogger(SysRecordController.class);

    @Resource
    private SysRecordService recordService;


    private String prefix = "record/";

    /**
     * 操作日志管理页
     */
    @GetMapping("toReocrdPage")
    public String toReocrdPage() {
        return prefix + "list";
    }

    /**
     * 操作日志查询
     *
     * @return
     */
    @RequestMapping("pageRecordList")
    @ResponseBody
    public JSONObject pageRecordList(RecordVO vo, Integer currentPage, Integer pageSize) throws Exception {
        if(vo==null){
            vo = new RecordVO();
        }
        return recordService.pageRecord(vo,currentPage,pageSize);
    }
}
